<?php
/*::::::::::::::::::::::::::::::::::::::::
 System name: cpengine
 Short Desc: Full Russian Security Power Pack
 Version: 2.0 (Service Pack 2)
 Authors:  Arcanum (php@211.ru) &  Censored!
 Date: March 18, 2008
::::::::::::::::::::::::::::::::::::::::*/

if(!defined("BASE_DIR")) exit;



if (defined('ACP'))
{
$modul['ModulName'] = "Установка титлов вручную";
$modul['ModulPfad'] = "titles";
$modul['ModulVersion'] = "1.0";
$modul['Beschreibung'] = "Данный модуль предзназначен для установки титлов любых страниц вручную. ";
$modul['Autor'] = "priclude";
$modul['MCopyright'] = "&copy; 2004-2011 priclude";
$modul['Status'] = 1;
$modul['IstFunktion'] = 1;
$modul['AdminEdit'] = 1;
$modul['ModulFunktion'] = "titles";
$modul['CpEngineTagTpl'] = "[titles:XXX]";
$modul['CpEngineTag'] = "#\\\[titles(\\\d+)]#";
$modul['CpPHPTag'] = "<?php titles(''$1''); ?>";
}

function titles($rss_id)
{
	$rss_id  = preg_replace('/\D/', '', $rss_id);

	if (is_numeric($rss_id))
	{
		echo '<a href="', ABS_PATH, 'rss/rss-', $rss_id, '.xml" target="blank"><img src="',
			ABS_PATH, 'modules/rss/templates/feed.gif" border="0" title="RSS лента новостей" /></a>';
	}
}

// Подключение основного класса и конструктора таблиц в БД
require_once(BASE_DIR . "/modules/titles/sql.php");
require_once(BASE_DIR . "/modules/titles/class.titles.php");

if (defined("ACP") && $_REQUEST['action'] != 'delete') {
  $tpl_dir   = BASE_DIR . "/modules/titles/templates/";
  $lang_file = BASE_DIR . "/modules/titles/lang/" . $_SESSION['user_language'] . ".txt";
  global $AVE_DB, $AVE_Template;
  $AVE_Template->config_load($lang_file);
  $config_vars = $AVE_Template->get_config_vars();
  $AVE_Template->assign("config_vars", $config_vars);

  if (isset($_REQUEST['moduleaction']) && $_REQUEST['moduleaction'] != '') {

    switch ($_REQUEST['moduleaction']) {

      case '1':
        titles::titlesList($tpl_dir, $lang_file);
      break;

      case 'add':
        titles::titlesAdd();
      break;

      case 'del':
        titles::titlesDelete();
      break;

      case 'edit':
        titles::titleEdit($tpl_dir, $lang_file);
      break;

      case 'saveedit':
       titles::titlesSave();
      break;
    }
  }
}         /**/
?>